<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:decorate template="/resources/template/modelo.xhtml">
        <ui:define name="centro">
            <f:view encoding="ISO-8859-1">  
                <h:form>
                    <p:panel  header="Editar Autor" style="margin-bottom:10px;">  
                        <h:panelGrid columns="2">
                            <h:outputText value="ID" />
                            <h:outputText value="#{autorBean.autor.id}"/>
                            <h:outputText value="Último Nome:" />
                            <h:inputText value="#{autorBean.autor.ultimoNome}"></h:inputText>
                            <h:outputText value="Restante Nome:" />
                            <h:inputText value="#{autorBean.autor.restanteNome}"></h:inputText>    
                            <h:outputText value="Lattes:" />
                            <h:inputText value="#{autorBean.autor.lattes}"></h:inputText> 
                            <h:outputText value="Instituicao:" />
                                                       
                            <p:selectOneMenu value="#{autorBean.autor.instituicaoAutor.id}" effect="fade"  >
                                <f:selectItem itemLabel="Selecione" itemValue="" />
                                <f:selectItems value="#{instituicaoBean.listarInstituicoes()}" var="inst"  itemLabel="#{inst.nome}" itemValue ="#{inst.id}" />
                            </p:selectOneMenu>

                            <p:commandButton action="#{autorBean.editarAutor()}" value="Editar" ajax="false"   />
                            <p:commandButton actionListener="#{autorBean.novoAutor()}" action="/cadastros/autores/listarAutores.xhtml?faces-redirect=true" immediate="true" value="Cancelar" ajax="false" />

                        </h:panelGrid> 
                    </p:panel>    
                </h:form>
            </f:view>
        </ui:define>


    </ui:decorate>
</html>